Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isUpToDate based on package_config.json #4160

Merged
merged 11 commits into from
Mar 5, 2024

Conversation

sigurdm
Copy link
Contributor

@sigurdm sigurdm commented Mar 4, 2024

Updates the logic we use in _isUptoDate.

Fixes #4153

Instead of grepping the lockfile for presence of path-dependencies we compare timestamps against the pubspec.yamls of all packages mentioned in .dart_tool/package_config.json. In the "fast" case we avoid reading any other file than package_config.json, and avoid dealing with yaml.

This will make _isUpToDate possible when we introduce workspace support. We don't need to parse pubspec.yamls to find all packages in the workspace, but can rather just look at all the entries in package_config.json.

This PR also adds new entries in package_config.json: pub_cache, flutter_root and flutter_version. If any of these changes, we require a new resolution.

We remove the "checkForSdkUpdate" option. And now always redo resolution when the flutter or dart sdk gets updated.

Copy link
Member

@jonasfj jonasfj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor nits,

lib/src/entrypoint.dart Outdated Show resolved Hide resolved
lib/src/entrypoint.dart Outdated Show resolved Hide resolved
lib/src/entrypoint.dart Outdated Show resolved Hide resolved
lib/src/entrypoint.dart Outdated Show resolved Hide resolved
@sigurdm sigurdm merged commit 44bd80e into dart-lang:master Mar 5, 2024
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base ensureUptodate on .dart_tool/package_config.json
2 participants